package com.lj.queue.param;

import com.lj.queue.entity.DelayQueueMessage;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import jakarta.validation.constraints.NotNull;

/**
 * <p>
 * 延迟队列消息表 保存参数
 * </p>
 *
 * @author lj
 * @since 2025-07-21 16:55:02
 */
@Data
@Schema(description = "延迟队列消息表 保存参数")
public class DelayQueueMessageSaveParam {

    @Schema(description = "延迟队列id")
    @NotNull(message = "延迟队列id 不能为空")
    private Long queueId;

    @Schema(description = "消息内容")
    @NotBlank(message = "消息内容 不能为空")
    private String message;

    @Schema(description = "预计时间")
    @NotNull(message = "预计时间 不能为空")
    private LocalDateTime expectTime;

    public DelayQueueMessage toEntity() {
        DelayQueueMessage entity = new DelayQueueMessage();
        entity.setQueueId(queueId);
        entity.setMessage(message);
        entity.setExpectTime(expectTime);
        return entity;
    }
}
